import {Component, ViewChild} from '@angular/core';
import {NavController, Tabs, Platform} from 'ionic-angular';
import {StatusBar} from '@ionic-native/status-bar';
import {AboutPage} from '../about/about';
import {ContactPage} from '../contact/contact';
import {HomePage} from '../home/home';
import {AuthPage} from '../auth/auth';

@Component({
  templateUrl: 'tabs.html'
})
export class TabsPage {

  tab1Root = HomePage;
  tab2Root = AuthPage;
  tab3Root = ContactPage;

  @ViewChild('myTabs') tabRef: Tabs;

  constructor(public navCtrl: NavController,
              public platform: Platform,
              public statusBar: StatusBar) {

  }

  ionViewDidEnter() {
    console.log('select')
    // this.tabRef.select(1)
    this.platform.ready().then(() => {
      if(this.platform.is('android')){
        setTimeout(()=>{
          this.statusBar.hide()
          this.statusBar.show()
          this.statusBar.overlaysWebView(true)
          this.statusBar.styleDefault()
          this.statusBar.backgroundColorByHexString('#00000000')
        },500)
      }
    })
  }

}
